package com.lianqi.emcpframework.core.bean;

import lombok.AllArgsConstructor;

/**
 * @program emcp-framework
 * @ClassName CacheKey
 * @description:
 * @author: sky
 * @create: 2018/11/16 22:38
 */
@AllArgsConstructor
public class CacheKey {

    private Class targtType;

    private Class sourceType;

    @Override
    public int hashCode(){
        int result = this.targtType != null ? this.targtType.hashCode() : 0;
        result = 31 * result + (this.sourceType != null ? this.sourceType.hashCode() : 0);
        return result;
    }

    @Override
    public boolean equals(Object object){
        if (!(object instanceof CacheKey)){
            return false;
        }
        CacheKey cacheKey = (CacheKey) object;
        return cacheKey.targtType == targtType && cacheKey.sourceType == sourceType;
    }

}
